﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.Threading.Tasks;
using System.Windows;
using System.Windows.Controls;
using System.Windows.Media;

namespace kinect_draw.Class
{
    public static class StaticFunctions
    {
        public static Point getPosition(this UIElement e)
        {
            return new Point() { X = Canvas.GetLeft(e), Y = Canvas.GetTop(e) };
        }
        public static void fixResoulution(this Canvas @Canvas, Size fromSize, Size toSize)
        {
            ScaleTransform s = new ScaleTransform(fromSize.Width / toSize.Width, fromSize.Height/toSize.Height);
            Canvas.RenderTransform = s;
        }
        public static void setPosition(this UIElement layout, Point pos)
        {
            Canvas.SetLeft(layout, pos.X);
            Canvas.SetTop(layout, pos.Y);
        }
    }
}
